home *** CD-ROM | disk | FTP | other *** search
- Path: newsfeed.direct.ca!usenet
- From: qjackson@direct.ca
- Newsgroups: comp.lang.ada,comp.lang.c++,comp.lang.c,comp.lang.modula3,comp.lang.modula2,comp.lang.eiffel
- Subject: Re: Hungarian notation
- Date: Wed, 24 Jan 1996 15:46:14 GMT
- Organization: Parsepolis Software
- Message-ID: <4e5k6o$aci@grid.direct.ca>
- References: <30C40F77.53B5@swsbbs.com> <4cvu68$2jb@macaw.cyberport.com> <4d21og$iab@news.xmission.com> <4d2ok0$69s@beach.and.nl> <4dtv3gINNo9u@keats.ugrad.cs.ubc.ca>
- Reply-To: qjackson@direct.ca
- NNTP-Posting-Host: 204.174.249.41
- X-Newsreader: Forte Free Agent 1.0.82
-
- c2a192@ugrad.cs.ubc.ca (Kazimir Kylheku) wrote:
-
- >> typedef char* empnm_t;
- >> typedef char* beernm_t;
-
- >Even that is going overboard. Someone will later see "empnm_t", and wonder what
- >the heck it is. If you mean "char *", just say "char *". The typedef operator
- >has its uses, but redefining simple types, like char * or int is not one of
- >them. The chief advantage is that you can use it with structs so that you can
- >eliminate having to write the struct keyword later on.
-
- >I just wrote a 12000 line project that doesn't have one typedef in it (save for
- >automatically generated XDR definitions). The code is easy to read; I can go
- >back to it and understand precisely what is going on without hunting for nested
- >definitions.
-
- I use typedef primarily if I know that an underlying data type might
- change at some point in the future, and I want to have one central way
- of changing it. As in:
-
- typedef unsigned int STRING_LENGTH;
-
- STRING_LENGTH lenOfString (String& fooStr);
-
- Should I later decide that I need long integers, I just change that
- one typedef, not a whole lot of unsigned int's.
-
- Data abstraction.
-
- Cheers,
-
-
-
-
- --
- |
- Parsepolis Software | Quinn Tyler Jackson
- "ParseCity" | (aka 'Jamshid')
- >--------------------------| qjackson@direct.ca
- |---------------------->
-
-